# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=dqlite
pkgver=1.10.0
pkgrel=0
pkgdesc="Embeddable, replicated and fault tolerant SQL engine."
url="https://dqlite.io/"
arch="all"
license="LGPL-3.0"
depends="raft"
makedepends="libuv-dev sqlite-dev raft-dev autoconf automake libtool"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/canonical/dqlite/archive/v$pkgver.tar.gz"

prepare() {
	default_prepare
	autoreconf -i
}

build() {
	./configure  \
		--prefix=/usr
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/dqlite/LICENSE
}

sha512sums="
f7364d968d0d2aef0bbd59f55bb7f775b41d509b0d1af106357bdb470703e143081649742870491e5c75760d3f6159568395b4a671c446a26df744fd4f631d33  dqlite-1.10.0.tar.gz
"
